<template>
	<view class="contentA">
		<view class="title row">
			#
			<text class="price">价格</text>
			<text class="rowEnd">7天%</text>
		</view>

		<view class="list row" @click="changeitem(item.id)" v-for="(item, i) in lists">
			<text class="index"> {{ i + 1 }}</text>
			<view class="flex tit">
				<img :src="item.image">{{item.name}}
			</view>
			<text class="price">¥{{item.price}}</text>
			<text :style="{'color':item.zhangfu > 0 ? '#097F56' : '#F23742'}"
				class="rowEnd">{{item.zhangfu > 0 ? '+' +item.zhangfu : item.zhangfu}}%</text>
		</view>
	</view>
</template>
<script>
	export default {
		name: "index",
		props: {
			lists: {
				type: Array
			}

		},
		components: {},
		data() {
			return {};
		},
		methods: {
			changeitem(id) {
				this.$emit('changeitem', id)
			}
		},
		created() {},
		mounted() {},
	};
</script>
<style lang="scss" scoped>
	.contentA {
		font-size: 28rpx;
		padding: 20rpx 40rpx;
		background-color: #fff;
		padding-top: 0;

		.row {
			display: flex;
			align-items: center;
			justify-content: space-between;
			// gap: 20px;
			padding: 20rpx 0;

			.rowEnd {
				width: 86rpx;
				text-align: right;
			}

			.price {
				margin-right: 60rpx;
				flex: 1;
				text-align: right;
			}
		}

		.title {
			border-bottom: 2px solid #f4f4f4;
			color: #a0a0a0;
		}

		.list {
			.index {
				width: 20px;
				color: #a0a0a0;
			}

			.tit {
				gap: 20rpx;
				align-items: center;

				img {
					width: 30px;
					height: 30px;
					border-radius: 15px;
					font-weight: 500;
				}
			}
		}
	}
</style>